﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Net.Mail;
using System.Windows.Forms;
using System.Net;

namespace AndroidEditor.WForm
{
    /// <summary>
    /// 
    /// </summary>
    /// <remarks></remarks>
    public partial class SendMail : Form
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="SendMail"/> class.
        /// </summary>
        /// <remarks></remarks>
        public SendMail()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Handles the Click event of the button1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        /// <remarks></remarks>
        private void button1_Click(object sender, EventArgs e)
        {
            MailMessage mes = new MailMessage();
            mes.To.Add("641402697@qq.com");
            mes.From = new MailAddress("641402697@qq.com", "None", System.Text.Encoding.UTF8);
            mes.Body = textBox1.Text;
            mes.Subject = "Bug邮件";
            SmtpClient client = new SmtpClient("smtp.qq.com");
            client.Credentials = new NetworkCredential("641402697", "gg38574638");
            try
            {
                client.Send(mes);
            }
            catch (Exception ex)
            {
                MessageBox.Show("发送失败！");
            }
            DialogResult = DialogResult.OK;
        }

        /// <summary>
        /// Handles the Click event of the button2 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        /// <remarks></remarks>
        private void button2_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
        }

        /// <summary>
        /// Handles the TextChanged event of the textBox1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        /// <remarks></remarks>
        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }
    }
}
